﻿
<div>
    <div class="title-bold-16">
        Add/Edit insight
    </div>
    Company Name: <b>{{insightCompany.companyName}}</b><br /><br />
    <div style="display: table; width: 99%;">
        <div class="table-row-inp">
            <div class="inp-label">
                Publication Date
            </div>
            <div class="inp-holder">
                <input name="insightPublicationDate" type="text" class="inp"
                       datepicker-popup="MM/dd/yyyy"
                       ng-model="insightCompany.currentInsight.publicationDate" ng-required="true" is-open="insightCompany.publicationDateOpen" ng-click="insightCompany.publicationDateOpen = true" />
            </div>
        </div>
        <div class="table-spacer">&nbsp;</div>
        <div class="table-row-inp">
            <div class="inp-label">
                Title
            </div>
            <div class="inp-holder">
                <input name="insightTitle" type="text" class="inp" ng-model="insightCompany.currentInsight.title" required>
            </div>
        </div>
        <div class="table-spacer">&nbsp;</div>
        <div class="table-row-inp">
            <span>{{insightCompany.currentInsight.fileName}}</span>
            <input type="file" id="insightFile" ng-file-select="insightCompany.onSelectPdf($files, insightCompany.currentInsight, insightCompany.companyProfile);" accept=".pdf" /><br />
            <span class="ui-state-error-text" id="pdfProfile"></span>

            <!-- hidden element for validation -->
            <input name="insightFile" type="text" ng-required="true" ng-model="insightCompany.currentInsight.fileUrl" hidden />
            <!--<input class="btn-green" type="button" value="Upload" ng-click="insightCompany.uploadInsightFile();">-->
        </div>
        <div class="table-spacer">&nbsp;</div>
    </div><br />
    <button class="btn-green" ng-click="insightCompany.saveInsight(insightCompany.currentInsight)" ng-disabled="insightCompany.isSaveDisabled">Save Changes</button>
    <button class="btn-green" ng-click="insightCompany.cancel()">Cancel</button> 
</div>
